package phone.qyg.com.qyg.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 作者：lblbh on 2017/3/18 12:47
 * 邮箱：lanbuhan@163.com
 * 功能：消息
 */
public class Message implements Parcelable {

    public int id;
    public int isRead;
    public String content;
    public String sendTime;

    public Message() {}

    @SuppressWarnings("unchecked")
    public Message(Parcel in) {
        id = in.readInt();
        isRead = in.readInt();
        content = in.readString();
        sendTime = in.readString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeInt(isRead);
        dest.writeString(content);
        dest.writeString(sendTime);

    }

    public static final Creator<Message> CREATOR = new Creator<Message>() {
        @Override
        public Message[] newArray(int size) {
            return new Message[size];
        }

        @Override
        public Message createFromParcel(Parcel in) {
            return new Message(in);
        }
    };
}
